# 常用内置模块
from datetime import datetime

# print(datetime.now())
# now = datetime.now()

# print(now.timestamp())

# 字符串转换为时间对象

# def dateFormat(timeStr):
#     return datetime.strptime(timeStr, '%Y-%m-%d')

# time = dateFormat('2020-2-1')

# print(time)

# 格式化时间对象输出

# print(datetime.strftime(datetime.now(), '%Y/%m/%d %H:%M'))

# 时间加减

# 加一个月
# timedelta 只支持到days, 30天，不能到一个月
# 要计算一个月的时间(闰年2月/大小月等)使用dateutil

# from dateutil.relativedelta import relativedelta

# start_time = datetime(2020, 1, 30)

# end_time = start_time + relativedelta(months=1, days=0)

# print(start_time)
# print(end_time)

# collection

# from collections import namedtuple

# Point = namedtuple('Point', ['x', 'y'])

# p = Point(5, 10)

# print(p)
# print(p.x)

# print(pp)

# base64

# from base64 import urlsafe_b64decode, urlsafe_b64encode

# url = '/crn_config?CRNModuleName=rn_igt_airport+aaa'

# print(type(url))
# # 需要先把字符串转成bytes
# url = url.encode('UTF-8')

# encode_url = urlsafe_b64encode(url)
# decode_url = urlsafe_b64decode(encode_url)
# print(encode_url)
# print(decode_url)

# print(decode_url.decode())
